home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / 172anew.zip / UPTEST.DOC < prev    next >
Text File  |  1989-05-23  |  2KB  |  56 lines

  1. Documentation for Upload Testing for RBBS 17.2A
  2. by Ken Goosens
  3. 24 May 1989
  4.  
  5. RBBS, in the drive/path where command.com is, now looks for a file
  6. called T<ext>.BAT, when <ext> is extension of file uploaded.
  7. If found, RBBS will shell to this processing.  This allows the sysop
  8. to install whatever processing desired after an upload.  The main
  9. application is to test the upload for integrity, but any processing
  10. desired is possible.
  11.  
  12.    If the BAT file contains exactly 1 line, RBBS will shell not to
  13. the BAT file but to the contents of the bat file, after substituting
  14. the name of the file upload for "[1]" and the name of the file to
  15. write the results to for "[2]".  If the BAT file contains more than
  16. one line, RBBS will shell to the BAT file itself,  passing file to
  17. test as 1st parmeter and file to write out results of test as 2nd.
  18.  
  19.     The upload will be treated as BAD, and deleted, if the result file
  20. has a length greater than 2 bytes.  The BAT file should either not
  21. write a result file or an empty one if the upload is okay; otherwise
  22. write out some error message more than 2 bytes long.
  23.  
  24.    One way to do this is to run a test of the compression and pipe the
  25. results to a text scanner than looks for an error string and redirects the
  26. output to a file if an error is found.   For example,  the file VARC.BAT
  27.  
  28.          PKXARC -T [1] | FGREP "error in a" > [2]
  29.  
  30. works.  Another possibility is
  31.  
  32.         ARCE [1] /T/P | FGREP "Invalid a" > [2]
  33.  
  34. Note:  both PKXARC and ARCE set the errorlevel above 0 if the arc
  35. is bad.  An alternative implementation is:
  36.  
  37.          PKXARC -T %1
  38.          IF ERRORLEVEL 1 ECHO BAD UPLOAD > %2
  39.          SETERROR 0
  40. or
  41.          ARCE %1 /T
  42.          IF ERRORLEVEL 1 ECHO BAD UPLOAD > %2
  43.          SETERROR 0
  44.  
  45. Under versions of Quick Basic prior to 4.5, programs that
  46. reset the error level cause illegal function call 5 upon return from
  47. the shell.  Therefore it is necessary to run a utility to reset the
  48. error level back to 0 before going back to RBBS.  This is what the
  49. SETERROR.EXE file does.
  50.  
  51. The recommended procedure is to use PKXARC, check errorlevel, and
  52. reset errorlevel to 0.  PKXARC runs faster, ARCE will hang on certain
  53. invalid ARC files, and, finally, both ARCE and PKXARC put out somewhat
  54. variable strings when different errors occur, making a filter based
  55. on text more difficult to implement.
  56.